//
//  XbnFocusPageControl.m
//  XbnLcBuyer
//
//  Created by ZhaoDongBo on 15/9/9.
//  Copyright (c) 2015年 ZhaoDongbo. All rights reserved.
//

#import "XbnFocusPageControl.h"

@implementation XbnFocusPageControl

- (void)updateDots
{
    for (int i = 0; i< [self.subviews count]; i++) {
        UIImageView* dot = [self.subviews objectAtIndex:i];

        if (i == self.currentPage){
            dot.backgroundColor = UIColorFromRGB(0xffffff, 1);
        }
        else{
            dot.backgroundColor = UIColorFromRGB(0xffffff, 0.25);
        }
    }
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    [self updateDots];
}

- (void)setCurrentPage:(NSInteger)currentPage
{
    [super setCurrentPage:currentPage];
    [self updateDots];
}

@end
